package xing.design.pattern.behavioral.command.sample1;

//import xing.design.pattern.behavioral.strategy.behavior.Cycle;
import xing.design.pattern.behavioral.command.sample1.behavior.DefaultEat;
import xing.design.pattern.behavioral.strategy.behavior.Walk;

/**
 * @author xing
 * @date 2023/2/8 0:59:58
 */
public class Main {
    public static void main(String[] args) {
        DefaultEat defaultEat = new DefaultEat();
        // 行为 1
        Person person = new Person(defaultEat);
        person.doSomething();

        // 行为 2
        person.setDoSomething(new Walk());
        person.doSomething();

        // 行为 3
        person.setDoSomething(() -> {
            System.out.println("坐下写作业");
        });
        person.doSomething();
    }
}
